dosseg
.model small
.stack ;100h

.data
;$label d[b,w] [$data, $num dup($data)]
;CR = 0Dh, LF = 0Ah
selection db 0	;selected item on the menu
backgrColor dw 0h
winBorder dw 20h
winColor dw 71h
selectionColor dw 29h

menuSize db 4
stringlist dw 0, 0, 0, 0, 0		;has to end with a 0
item1 db "selection 1", 0Dh, 0Ah, "$" 
item2 db "selection 2", 0Dh, 0Ah, "$"
item3 db "selection 3", 0Dh, 0Ah, "$"
item4 db "Quit.", 0Dh, 0Ah, "$"

.code
main proc
windowStart:
	;clear the display
	mov ax, 0600h
	mov bx, backgrColor
	mov cx, 0
	mov dx, 184Fh
	int 10h

	;draw border window
	mov ax, 0600h
	mov bx, winBorder	;moving two separate bytes into bh
	mov cx, 0205h		;14 (Eh) tall
	mov dx, 101Ah		;21 (15h) wide
	int 10h

	;draw main window
	mov ax, 0600h
	mov bx, winColor
	mov cx, 0306h		;1 down 1 over
	mov dx, 111Bh		;same size
	int 10h

	;there is 1 line margin in the window, 1 line between each string
	;first line of window is 3, text is 4, 6, 8, 10(Ah)
	;add 2, then double
	mov al, selection
	add 2
	mul 2
			;2*([0, 1, 2, 3]+2) = [4, 6, 8, 10]
	mov dh, al
	mov ah, 2
	mov bx, 0
	mov dl, 07h
	int 10h
		
	
	;draw highlighting
	mov ax, 0600h
	mov bx, selectionColor
	mov ch, ah
	mov cl, 4
	mov dh, ch
	mov dl, 
	
	;print the string
	mov ah, 9
	mov bx, 0
	inc si
	inc si		;double increment to get words
	mov dx, stringlist[si]
	int 21h

	;writing strings
	;move the offsets into a dw "array"
	mov bx, 0
	mov ax, offset item1
	mov stringlist[bx], ax
	add bx, 2
	
	mov ax, offset item2
	mov stringlist[bx], ax
	add bx, 2
	
	mov ax, offset item3
	mov stringlist[bx], ax
	add bx, 2
	
	mov ax, offset item4
	mov stringlist[bx]
	add bx, 2
	
	mov ax, 0
	mov stringlist[bx]
	;the function just has to go word by word until a sentinel value 0
	

	

	;write text
	;wait for keypress
	;handle keypress
		;selection 
	;loop
main endp
;

end main
